
/*
class Solution {
//从根到叶的二进制之和
    public int sumRootToLeaf(TreeNode root) {
        return dfs(root, 0);
    }

    public int dfs(TreeNode root, int val) {
        if (root == null) {
            return 0;
        }
        val = (val << 1) | root.val;
        if (root.left == null && root.right == null) {
            return val;
        }
        return dfs(root.left, val) + dfs(root.right, val);
    }
}*/

/*
class Solution {
//前序遍历二叉搜索树
    int i = 0;
    public TreeNode bstFromPreorder(int[] preorder) {
        return insert(preorder,Integer.MAX_VALUE);
    }
    TreeNode insert(int[] preorder ,int max){
        if(i == preorder.length){
            return null;
        }
        int val = preorder[i];
        if(val > max){
            return null;
        }
        TreeNode node = new TreeNode(val);
        i++;
        node.left = insert(preorder,val);
        node.right = insert(preorder,max);
        return node;
    }
}
*/
